require 'gamifier/dsl/network'
require 'gamifier/dsl/api_key'
require 'gamifier/dsl/site'

module Gamifier
  module DSL
    class << self
      def eval_with_context(new_context, &block)
        new_context.extend DSL
        if block
          new_context.instance_eval(&block)
        end
        new_context
      end
    end

    def set(key, *args, &block)
      if block
        self.send("#{key}=".to_sym, block)
      else
        self.send("#{key}=".to_sym, *args)
      end
    end
  end
end
